import request from "@/utils/request";

// 查询商品类别列表
export function listCategory(query) {
  return request({
    url: "/category/list",
    method: "get",
    params: query,
  });
}

// 查询商品类别
export function getCategory(categoryID) {
  return request({
    url: "/category/" + categoryID,
    method: "get",
  });
}

// 新增商品类别
export function addCategory(data) {
  return request({
    url: "/category",
    method: "post",
    data: data,
  });
}

// 修改商品类别
export function updateCategory(data) {
  return request({
    url: "/category",
    method: "put",
    data: data,
  });
}

// 删除商品类别
export function deleteCategory(categoryID) {
  return request({
    url: "/category/delete/" + categoryID,
    method: "delete",
  });
}
